home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #2
/
Monster Media No. 2 (Monster Media)(1994).ISO
/
modem
/
tlxtw202.zip
/
HANGUP.SLT
< prev
next >
Wrap
Text File
|
1994-05-05
|
4KB
|
122 lines
// hangup.slt
// see lines 13 and 37
int flag = 0, statline, statline_color, h, i, Len, x, y;
str bbsname[15], c[64];
///////////////////////////////////////////////////////////////////////////////
main()
{
if(cinp_cnt())
flushbuf();
_scr_chk_key = 0;
_back_color = 0;
_fore_color = 7;
_script_dir = "C:\TELIX\WORK\SLC\"; //
//////////////////////////////////////////////////////////////////////////////
i = keyload("telix.key"); // reload default .key file
if ( i != -1 ) printsc("^M^JTelix.key loaded." );
printsc("^M^JScript directory: ");
printsc( _script_dir );
prints("");
update_term();
newdir(_telix_dir);
x=getx(); y=gety();
if (!chk_stat(0))
chk_stat(24);
pstraxy(" │", 0, statline, statline_color);
gotoxy(x,y);
if ( capture_stat() == 1 || capture_stat() == 2 ) {
subchrs(_capture_fname, 0, strlen(_capture_fname), c); strcat(c, " closed");
Len = 40 - strlen(c) / 2 ;
capture ( "*close*" );
h = vsavearea(Len - 4, 15, Len + strlen(c) + 3, 17);
box(Len - 4, 15, Len + strlen(c) + 3, 17, 3 ,0 ,31);
pstraxy( c, Len, 16, 30);
}
///////////////////////////////////////////////////////////////////////////////
// reset default capture file name
_capture_fname = "D:\CAP"; //
///////////////////////////////////////////////////////////////////////////////
if ( carrier() ) {
i=0;
while( i == 0 && inkey() != 27 ) {
i=hangup();
if(i > 0) break;
vrstrarea(h); gotoxy( 0, y );
delay_scr(10);
cputs_tr(_mdm_hang_str);
if (waitfor("OK", 3) ) break;
delay_scr(5);
}
}
vrstrarea(h);
pstraxy( _entry_name, 0, statline, statline_color);
gotoxy(0, y);
while ( inkey() != 27 ) {
cputs_tr(_mdm_init_str);
if ( waitfor("OK", 2 )) break;
delay_scr(2);
}
cursor_onoff(1);
clean_tempdir();
_scr_chk_key = 1;
return 1;
}
///////////////////////////////////////////////////////////////////////////////
// Check Row and Color of Status Line
chk_stat ( int statchk )
{
gotoxy(67, statchk);
if ((vgetchr() & 255) == 79 ) {
Statline = statchk;
statline_color = vgetchr()/256;
return 1;
}
else return 0;
}
///////////////////////////////////////////////////////////////////////////////
clean_tempdir()//delete unwanted files in the temp directory
{
str tempdir[64],buf[64];
int f;
if(!getenv("temp",tempdir)) {
soft_wind("^"Temp^" Environment variable not found!",30);
return 0;
}
newdir(tempdir);
fdelete("Entrynam.txt");
// add any more files here
newdir(_telix_dir);
return 1;
}
///////////////////////////////////////////////////////////////////////////////
append_backslash( str string )
{
if(subchr(string,strlen(string)-1)!='\')strcat(string,"\");
return string;
}
/////////////////////////////////////////////////////////////////////////////
// Soft Wind
soft_wind(str message, int duration)
{
int old_chk_key;
old_chk_key = _scr_chk_key;
_scr_chk_key = 0;
int l, h, x, y, key = 0, ts;
cursor_onoff(0);
x=getx(); y=gety();
l = strlen(message)/2;
h = vsavearea(37-l, 10, 43+l, 14);
box(37-l, 10, 43+l, 14, 3, 0, 5 );
pstraxy(message, 40-l , 12, 11 );
ts = timer_start(duration);
while( !key && !time_up(ts)) key=inkey();
vrstrarea(h);
cursor_onoff(1);
gotoxy(x,y);
timer_free(ts);
_scr_chk_key = old_chk_key;
return key;
}
//////////////////////////////////////////////////////////////////////////////